package com.yk.server;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by dingkl on 2017/7/27.
 */
public class RPCClass {

    private Map<String,Object> classes = new HashMap();

    private static RPCClass rpcClass;

    private RPCClass(){}

    public static RPCClass getInstace(){
        if (rpcClass==null){
            synchronized (RPCClass.class){
                if (rpcClass==null){
                    rpcClass = new RPCClass();
                }
            }
        }
        return rpcClass;
    }

    public void add(String key,Object value){
        classes.put(key,value);
    }

    public Object get(String key){
        if (classes.containsKey(key)){
            return classes.get(key);
        }
        return null;
    }

    public void delete(String key){
        classes.remove(key);
    }

}
